package cat.inkubator.plugin4j.updater;
import java.net.*;
import java.io.*;

/**
 *
 * @author gato
 */
public class ObtainWebInfo {
    
    public static String obtainXMLFrom( String url ){
        StringBuffer data = new StringBuffer();
        
        try{
            String obtained;
            URL u = new URL( url );
            DataInputStream theHTML = new DataInputStream(u.openStream());
            while ((obtained = theHTML.readLine()) != null) {
                data.append( obtained );
            }
            theHTML.close();
        }catch( MalformedURLException e ){
            e.printStackTrace();
        }catch( IOException e ){
            e.printStackTrace();
        }
        
        return data.toString();
    }
    
}